/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package posartenobsa;

import com.sun.data.provider.impl.CachedRowSetDataProvider;
import com.sun.rave.faces.data.DefaultTableDataModel;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.sql.rowset.CachedRowSetXImpl;
import com.sun.webui.jsf.component.DropDown;
import com.sun.webui.jsf.component.StaticText;
import com.sun.webui.jsf.component.Table;
import com.sun.webui.jsf.component.TableColumn;
import com.sun.webui.jsf.component.TableRowGroup;
import com.sun.webui.jsf.component.TextField;
import com.sun.webui.jsf.model.DefaultTableDataProvider;
import com.sun.webui.jsf.model.SingleSelectOptionsList;
import javax.faces.FacesException;
import javax.faces.component.UIColumn;
import javax.faces.component.html.HtmlInputText;
import javax.faces.convert.IntegerConverter;
import javax.faces.event.ValueChangeEvent;

/**
 * <p>Page bean that corresponds to a similarly named JSP page.  This
 * class contains component definitions (and initialization code) for
 * all components that you have defined on this page, as well as
 * lifecycle methods and event handlers where you may add behavior
 * to respond to incoming events.</p>
 *
 * @version A_Exposicion.java
 * @version Created on 21/03/2012, 07:43:15 AM
 * @author Fabio
 */

public class A_Exposicion extends AbstractPageBean {
    // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">

    /**
     * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
     * This method is automatically generated, so any user-specified code inserted
     * here is subject to being replaced.</p>
     */
    private void _init() throws Exception {
        lugar_exposicionDataProvider.setCachedRowSet((javax.sql.rowset.CachedRowSet) getValue("#{SessionBean1.lugar_exposicionRowSet}"));
        pruebaDataProvider.setCachedRowSet((javax.sql.rowset.CachedRowSet) getValue("#{A_Exposicion.pruebaRowSet}"));
        pruebaRowSet.setDataSourceName("java:comp/env/jdbc/public_PostgreSQL");
        pruebaRowSet.setCommand("SELECT * FROM \"public\".producto");
        pruebaRowSet.setTableName("producto");
    }
    private SingleSelectOptionsList CB_LugarexpoModDefaultOptions = new SingleSelectOptionsList();

    public SingleSelectOptionsList getCB_LugarexpoModDefaultOptions() {
        return CB_LugarexpoModDefaultOptions;
    }

    public void setCB_LugarexpoModDefaultOptions(SingleSelectOptionsList ssol) {
        this.CB_LugarexpoModDefaultOptions = ssol;
    }
    private SingleSelectOptionsList CBBuscarexpoDefaultOptions = new SingleSelectOptionsList();

    public SingleSelectOptionsList getCBBuscarexpoDefaultOptions() {
        return CBBuscarexpoDefaultOptions;
    }

    public void setCBBuscarexpoDefaultOptions(SingleSelectOptionsList ssol) {
        this.CBBuscarexpoDefaultOptions = ssol;
    }
    private SingleSelectOptionsList CBBuscarexpoModDefaultOptions = new SingleSelectOptionsList();

    public SingleSelectOptionsList getCBBuscarexpoModDefaultOptions() {
        return CBBuscarexpoModDefaultOptions;
    }

    public void setCBBuscarexpoModDefaultOptions(SingleSelectOptionsList ssol) {
        this.CBBuscarexpoModDefaultOptions = ssol;
    }
    private CachedRowSetDataProvider lugar_exposicionDataProvider = new CachedRowSetDataProvider();

    public CachedRowSetDataProvider getLugar_exposicionDataProvider() {
        return lugar_exposicionDataProvider;
    }

    public void setLugar_exposicionDataProvider(CachedRowSetDataProvider crsdp) {
        this.lugar_exposicionDataProvider = crsdp;
    }
    private DefaultTableDataProvider defaultTableDataProvider = new DefaultTableDataProvider();

    public DefaultTableDataProvider getDefaultTableDataProvider() {
        return defaultTableDataProvider;
    }

    public void setDefaultTableDataProvider(DefaultTableDataProvider dtdp) {
        this.defaultTableDataProvider = dtdp;
    }
    private CachedRowSetDataProvider pruebaDataProvider = new CachedRowSetDataProvider();

    public CachedRowSetDataProvider getPruebaDataProvider() {
        return pruebaDataProvider;
    }

    public void setPruebaDataProvider(CachedRowSetDataProvider crsdp) {
        this.pruebaDataProvider = crsdp;
    }
    private CachedRowSetXImpl pruebaRowSet = new CachedRowSetXImpl();

    public CachedRowSetXImpl getPruebaRowSet() {
        return pruebaRowSet;
    }

    public void setPruebaRowSet(CachedRowSetXImpl crsxi) {
        this.pruebaRowSet = crsxi;
    }
    private IntegerConverter dropDown1Converter = new IntegerConverter();

    public IntegerConverter getDropDown1Converter() {
        return dropDown1Converter;
    }

    public void setDropDown1Converter(IntegerConverter ic) {
        this.dropDown1Converter = ic;
    }
    private TextField textField1 = new TextField();

    public TextField getTextField1() {
        return textField1;
    }

    public void setTextField1(TextField tf) {
        this.textField1 = tf;
    }
    private Table table1 = new Table();

    public Table getTable1() {
        return table1;
    }

    public void setTable1(Table t) {
        this.table1 = t;
    }
    private TableColumn tableColumn2 = new TableColumn();

    public TableColumn getTableColumn2() {
        return tableColumn2;
    }

    public void setTableColumn2(TableColumn tc) {
        this.tableColumn2 = tc;
    }
    private TableColumn tableColumn1 = new TableColumn();

    public TableColumn getTableColumn1() {
        return tableColumn1;
    }

    public void setTableColumn1(TableColumn tc) {
        this.tableColumn1 = tc;
    }
    private TableColumn tableColumn3 = new TableColumn();

    public TableColumn getTableColumn3() {
        return tableColumn3;
    }

    public void setTableColumn3(TableColumn tc) {
        this.tableColumn3 = tc;
    }
    private TableRowGroup tableRowGroup1 = new TableRowGroup();

    public TableRowGroup getTableRowGroup1() {
        return tableRowGroup1;
    }

    public void setTableRowGroup1(TableRowGroup trg) {
        this.tableRowGroup1 = trg;
    }
    private DropDown dropDown1 = new DropDown();

    public DropDown getDropDown1() {
        return dropDown1;
    }

    public void setDropDown1(DropDown dd) {
        this.dropDown1 = dd;
    }
    private StaticText staticText3 = new StaticText();

    public StaticText getStaticText3() {
        return staticText3;
    }

    public void setStaticText3(StaticText st) {
        this.staticText3 = st;
    }
    private DefaultTableDataModel dataTable1Model = new DefaultTableDataModel();

    public DefaultTableDataModel getDataTable1Model() {
        return dataTable1Model;
    }

    public void setDataTable1Model(DefaultTableDataModel dtdm) {
        this.dataTable1Model = dtdm;
    }
    private UIColumn column1 = new UIColumn();

    public UIColumn getColumn1() {
        return column1;
    }

    public void setColumn1(UIColumn uic) {
        this.column1 = uic;
    }
    private HtmlInputText textField2 = new HtmlInputText();

    public HtmlInputText getTextField2() {
        return textField2;
    }

    public void setTextField2(HtmlInputText hit) {
        this.textField2 = hit;
    }

    // </editor-fold>

    /**
     * <p>Construct a new Page bean instance.</p>
     */
    public A_Exposicion() {
    }

    /**
     * <p>Callback method that is called whenever a page is navigated to,
     * either directly via a URL, or indirectly via page navigation.
     * Customize this method to acquire resources that will be needed
     * for event handlers and lifecycle methods, whether or not this
     * page is performing post back processing.</p>
     * 
     * <p>Note that, if the current request is a postback, the property
     * values of the components do <strong>not</strong> represent any
     * values submitted with this request.  Instead, they represent the
     * property values that were saved for this view when it was rendered.</p>
     */
    @Override
    public void init() {
        // Perform initializations inherited from our superclass
        super.init();
        // Perform application initialization that must complete
        // *before* managed components are initialized
        // TODO - add your own initialiation code here
        
        // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
        // Initialize automatically managed components
        // *Note* - this logic should NOT be modified
        try {
            _init();
        } catch (Exception e) {
            log("A_Exposicion Initialization Failure", e);
            throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
        }
        
        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        // TODO - add your own initialization code here
    }

    /**
     * <p>Callback method that is called after the component tree has been
     * restored, but before any event processing takes place.  This method
     * will <strong>only</strong> be called on a postback request that
     * is processing a form submit.  Customize this method to allocate
     * resources that will be required in your event handlers.</p>
     */
    @Override
    public void preprocess() {
    }

    /**
     * <p>Callback method that is called just before rendering takes place.
     * This method will <strong>only</strong> be called for the page that
     * will actually be rendered (and not, for example, on a page that
     * handled a postback and then navigated to a different page).  Customize
     * this method to allocate resources that will be required for rendering
     * this page.</p>
     */
    @Override
    public void prerender() {
    }

    /**
     * <p>Callback method that is called after rendering is completed for
     * this request, if <code>init()</code> was called (regardless of whether
     * or not this was the page that was actually rendered).  Customize this
     * method to release resources acquired in the <code>init()</code>,
     * <code>preprocess()</code>, or <code>prerender()</code> methods (or
     * acquired during execution of an event handler).</p>
     */
    @Override
    public void destroy() {
        lugar_exposicionDataProvider.close();
        pruebaDataProvider.close();
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected SessionBean1 getSessionBean1() {
        return (SessionBean1) getBean("SessionBean1");
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected ApplicationBean1 getApplicationBean1() {
        return (ApplicationBean1) getBean("ApplicationBean1");
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected RequestBean1 getRequestBean1() {
        return (RequestBean1) getBean("RequestBean1");
    }

    public String HPL_AUsuario1_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
        return "case1";
    }

    public String HPL_ASocio_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
        return "case2";
    }

    public String hyperlink2_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
        return "case3";
    }

    public String HPL_ADeposito_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
        return "case4";
    }

    public String HPL_AExposicion1_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
        return null;
    }

    public String HPL_Vender_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
        return "case5";
    }

    public String tabMExpo_action() {
        // TODO: Replace with your code
        return null;
    }

    public String tabCExpo_action() {
        // TODO: Replace with your code
        return null;
    }

    public String tabDExpo_action() {
        // TODO: Replace with your code
        return null;
    }

    public String tabMercSaliente_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
        return null;
    }

    public String button1_action() {


       staticText3.setText("Hola"+String.valueOf(textField1.getText()));
       staticText3.setValue(table1);
       return null;
    }

    public void textField1_processValueChange(ValueChangeEvent event) {
    }

    public void dropDown1_processValueChange(ValueChangeEvent event) {
    }

    public void textField2_processValueChange(ValueChangeEvent vce) {
    }
    
}

